package com.mszlu.blog.controller;

import com.mszlu.blog.service.UserService;
import com.mszlu.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: lfw
 * @Date: 2022/03/22/19:36
 * @Description:
 */
@RestController
@RequestMapping("users")
public class UsersController {
    @Autowired
    private UserService userService;
    @GetMapping("currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token){
        return userService.findUserByToken(token);
    }
}
